package com.sydsen.imager.elements;

import com.sydsen.imager.ElementWrapper;

/**
 * @Auther: syh
 * @Date: 2021/11/1
 * @Description:
 */
public class Element<T> extends ElementWrapper {

    /**
     * 元素相对于背景图左上角坐标(0,0)的x像素距离
     */
    private int x;

    /**
     * 元素相对于背景图左上角坐标(0,0)的x像素距离
     */
    private int y;

    /**
     * 元素宽度
     */
    private int width;

    /**
     * 元素长度
     */
    private int height;

    /**
     * 元素透明度
     */
    private float alpha = 1.0f;

    /**
     * 元素水平居中
     */
    private boolean center;

    /**
     * 元素垂直居中
     */
    private boolean middle;

    /**
     * 元素旋转
     */
    private int rotate;

    public int x() {
        return x;
    }

    public T x(int x) {
        this.x = x;
        return (T) this;
    }

    public int y() {
        return y;
    }

    public T y(int y) {
        this.y = y;
        return (T) this;
    }

    public int width() {
        return width;
    }

    public T width(int width) {
        this.width = width;
        return (T) this;
    }

    public int height() {
        return height;
    }

    public T height(int height) {
        this.height = height;
        return (T) this;
    }

    public float alpha() {
        return alpha;
    }

    public T alpha(float alpha) {
        this.alpha = alpha;
        return (T) this;
    }

    public boolean center() {
        return center;
    }

    public T center(boolean center) {
        this.center = center;
        return (T) this;
    }

    public boolean middle() {
        return middle;
    }

    public T middle(boolean middle) {
        this.middle = middle;
        return (T) this;
    }

    public int rotate() {
        return rotate;
    }

    public T rotate(int rotate) {
        this.rotate = rotate;
        return (T) this;
    }
}
